<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'ajax.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script type="text/javascript"
			src="<%=basePath%>skins/javascript/jquery/jquery-1.6.1.min.js">
</script>
		<script type="text/javascript">
function loadInfo() {
	$("#info").load("./ajax/ajaxList.action");
}
function loadJson() {
	$.ajax( {
		type : "POST",
		url : "./ajax/jsonRetu.action",
		dataType : "json",
		success : function(data) {
			alert(data);
			var mag = eval("(" + data + ")");
			alert(mag);
			$("#json").html(
					"boolean:" + mag.jsonReturn.success + "<br />" + "msg:"
							+ mag.jsonReturn.msg);
		},
		error : function(msg) {
			alert(eval("(" + msg + ")"));
		}
	});
}
</script>
	</head>

	<body>
		<input type="button" value="获取" id="btnGet" onclick="loadInfo()" />
		<div id="info"></div>
		<input type="button" value="获取对象" id="btnGet" onclick="loadJson()" />
		<div id="json"></div>
	</body>
</html>
